package com.creditcmsplt.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.creditcmsplt.entity.CreditAuoth;
import com.creditcmsplt.mapper.CreditAuothMapper;
import com.creditcmsplt.service.CreditAuothService;

@Service
public class CreditAuothServiceImpl implements CreditAuothService {

	@Autowired
	private CreditAuothMapper creditAuothMapper;

	public Integer queryAuoth(String vendor_key, String vendor_secret) {
		List<Integer> result = this.creditAuothMapper.queryAuoth(vendor_key, vendor_secret);
		return result == null || result.size() <= 0 ? null : result.get(0);
	}

	public CreditAuoth queryToken(String vendor_key, String vendor_secret) {
		List<CreditAuoth> result = this.creditAuothMapper.queryToken(vendor_key, vendor_secret);
		return result == null || result.size() <= 0 ? null : result.get(0);
	}

	public Map<String,Object> checkToken(String token) {
		List<Map<String,Object>> result = this.creditAuothMapper.checkToken(token);
		return result == null || result.size() <= 0 ? null : result.get(0);
	}
}
